<?php
include "../config/koneksi.php";
include "../class/carapesan.php";

if (ISSET($_GET["id_pesan"])){
	$id_pesan=$_GET["id_pesan"];
	$pesan_dao = new Pesan_Dao();
	$pesan=$pesan_dao->get($id_pesan);
}
if (ISSET($_POST["edit"])){
	$pesan_dao = new Pesan_Dao();
	$pesan= new Pesan();
	$pesan->id_pesan = $_POST['id_pesan'];
	$pesan->carapesan = $_POST['carapesan'];
	$pesan_dao->edit($pesan);
	header("location:?menu=view_carapesan");
}
?>
<html>
<body>
<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="30""> 
      <div align="left"><font size="3" face="tahoma">Edit Cara Pemesanan</font><br></font><hr color=#CCCCFF>
     </div></td>
    </tr>
<form name="edit" method="post" action="">
<input type="hidden" name="edit">
<input type="hidden" name="id_pesan" value="<?php echo $pesan->id_pesan?>">
<table width="100%" border="0" bordercolor="#666666" bgcolor="#FFFFFF">
  <tr valign="middle" bordercolor="#FFFFFF"> 
    <td colspan="3"><div align="left"></div></td>
	</tr>
  <tr>
    <td valign="top">
    	<table width="100%" border="0" bordercolor="#000000">
    <tr bordercolor="#FFFFFF"> 
      <td><font size="2" face="tahoma">Cara Pemesanan :</font></td>
      <td valign=top></td>
      <td valign="top" align=left><font size="2" face="tahoma"><textarea name=carapesan cols=60 rows=10><?php echo $pesan->carapesan;?></textarea></td>
    </tr>
    <tr bordercolor="#FFFFFF"> 
      <td height="21" colspan="2"></td><td><font size="2" face="tahoma"> 
          <input type="submit" name="Submit42" value="Simpan">
		  <button type ="button" name="fulang2" value="Batal" class="btn btn-success" onClick="javascript:history.back()">Batal
          </font>
        </td>
   </tr>
	</tr>
		</table>
  </td>
	<? 
		
		echo"</tr></table>";
?>

</form>
<html>
<body>